{% load i18n %}

<fieldset class="grp-module module {{ fieldset.classes }}">
  {% if fieldset.name %}<h2 class="grp-collapse-handler">{{ fieldset.name }} Mass Edit</h2>{% endif %}
  {% if fieldset.description %}<div class="grp-row row"><p class="grp-description">{{ fieldset.description|safe }}</p></div>{% endif %}
  
  {% if general_error %}
    <div class="grp-errors errornote"> {{ general_error}} </div>
  {% endif %}
  
  <table>
    <tr>
      <th>
        {% trans "Mass Update?" %}
      </th>
      <th>
        {% trans "Field" %}
      </th>
    </tr>
    {% for line in fieldset %}
      {% if line.errors %}
        <tr>
          <td>
            {{ line.errors }}
          </td>
        </tr>
      {% endif %}
      
      {% for field in line %}
        <tr>
          {% if field.field.name in adminform.readonly_fields %}
            <td>
              
            </td>
            <td>
              {{ field.field.name }} {% trans "is read only." %}
            </td>
          {% else %}{% if field.field.name in unique_fields %}
            <td>
              
            </td>
            <td>
              {{ field.field.name }} {% trans "is unique." %}
            </td>
          {% else %}
            <td style="vertical-align: middle;">
              <input type="checkbox" name="_mass_change_{{ field.field.name }}" />
            </td>
            <td>
              {% if field.is_checkbox %}
                {{ field.field }}{{ field.label_tag }}
              {% else %}
                <div>
                  {{ field.label_tag }}
                </div>
                <div>
                  {{ field.field }}
                </div>
              {% endif %}
              {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %}
            </td>
          {% endif %}{% endif %}
        </tr>
      {% endfor %}
    {% endfor %}
  </table>
</fieldset>
